package com.tele.service.imps;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tele.domain.Database;
import com.tele.mapper.DataBaseMapper;
import com.tele.service.ints.DatabaseService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class DataBaseServiceImp extends ServiceImpl<DataBaseMapper, Database> implements DatabaseService {
    final DataBaseMapper dataBaseMapper;

    @Override
    public int insertDatabase(Database database) {
        return dataBaseMapper.insert(database);
    }

    @Override
    public int updateDatabase(Database database) {
        return baseMapper.updateById(database);
    }

    @Override
    public List<Database> getAllDatabase() {

        return dataBaseMapper.getAllDatabase();
    }

    @Override
    public int delDatabase(Database database) {
        return baseMapper.deleteById(database);
    }

}
